.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.navbar-title {
  margin: 0;
  font-size: 1.5rem;
  color: #2c3e50;
}

.navbar-buttons {
  display: flex;
  gap: 1rem;
}

.navbar-button {
  padding: 0.5rem 1rem;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.navbar-button:hover {
  background-color: #2980b9;
}

.navbar-button:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
}

.navbar-button.active {
  background-color: #2980b9;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.main-content {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.editor-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 0;
  transition: margin-right 0.3s ease;
}

.outline-panel {
  width: 250px;
  background-color: #f8f9fa;
  border-left: 1px solid #dee2e6;
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
}

.w-md-editor {
  flex: 1;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  border: none !important;
  margin: 0 !important;
}

.w-md-editor-fullscreen {
  position: fixed !important;
  width: calc(100% - 250px) !important;
  left: 0 !important;
  right: 250px !important;
  margin: 0 !important;
}

.w-md-editor-show-live {
  height: 100% !important;
}

@media (max-width: 768px) {
  .outline-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    background-color: #f8f9fa;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    width: 250px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .outline-panel.show {
    transform: translateX(0);
  }

  .editor-container.with-outline {
    margin-right: 0;
    width: 100%;
  }

  .w-md-editor-fullscreen {
    width: 100% !important;
    right: 0 !important;
  }
}

.outline-title {
  font-size: 1.2rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.outline-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.outline-item {
  cursor: pointer;
  padding: 0.25rem 0;
  color: #2c3e50;
  font-size: 0.9rem;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outline-item:hover {
  color: #3498db;
}

/* 优化编辑器样式 */
.w-md-editor-text {
  font-size: 16px !important;
  line-height: 1.6 !important;
}

.wmde-markdown {
  font-size: 16px !important;
  line-height: 1.6 !important;
  padding: 1rem !important;
}

.wmde-markdown code {
  background-color: #f8f9fa !important;
  padding: 0.2em 0.4em !important;
  border-radius: 3px !important;
  font-size: 0.9em !important;
}

.wmde-markdown pre {
  background-color: #2c3e50 !important;
  padding: 1rem !important;
  border-radius: 8px !important;
}

.wmde-markdown pre code {
  background-color: transparent !important;
  color: #ffffff !important;
  padding: 0 !important;
}

.wmde-markdown blockquote {
  border-left: 4px solid #3498db !important;
  padding: 0.5rem 1rem !important;
  color: #34495e !important;
  background-color: #f8f9fa !important;
}

.wmde-markdown table {
  border-collapse: collapse !important;
  width: 100% !important;
  margin-bottom: 1rem !important;
}

.wmde-markdown th,
.wmde-markdown td {
  border: 1px solid #dee2e6 !important;
  padding: 0.5rem !important;
}

.wmde-markdown th {
  background-color: #f8f9fa !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .outline-panel {
    display: none;
  }
}

@media (forced-colors: active) {
  .outline-panel {
    border-left-color: CanvasText;
    background-color: Canvas;
  }
  
  .outline-title {
    color: CanvasText;
    border-bottom-color: CanvasText;
  }
  
  .outline-item {
    color: CanvasText;
  }
  
  .outline-item:hover {
    color: LinkText;
  }

  .navbar-button {
    border: 1px solid CanvasText;
    background-color: ButtonFace;
    color: CanvasText;
  }

  .navbar-button:hover {
    background-color: ButtonFace;
    color: CanvasText;
  }
}

.wmde-markdown pre code {
  background-color: transparent !important;
  color: #ffffff !important;
  padding: 0 !important;
}

.wmde-markdown blockquote {
  border-left: 4px solid #3498db !important;
  padding: 0.5rem 1rem !important;
  color: #34495e !important;
  background-color: #f8f9fa !important;
}

.wmde-markdown table {
  border-collapse: collapse !important;
  width: 100% !important;
  margin-bottom: 1rem !important;
}

.wmde-markdown th,
.wmde-markdown td {
  border: 1px solid #dee2e6 !important;
  padding: 0.5rem !important;
}

.wmde-markdown th {
  background-color: #f8f9fa !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .outline-panel {
    display: none;
  }
}

@media (forced-colors: active) {
  .outline-panel {
    border-left-color: ButtonText;
    background-color: Canvas;
  }
  
  .outline-title {
    color: ButtonText;
    border-bottom-color: ButtonText;
  }
  
  .outline-item {
    color: ButtonText;
  }
  
  .outline-item:hover {
    color: LinkText;
  }
}

/* 添加大纲面板动画 */
.outline-panel {
  transition: all 0.3s ease;
}

/* 当大纲显示时调整编辑器容器的宽度 */
.editor-container.with-outline {
  margin-right: 250px;
  width: calc(100% - 250px);
}

/* 当不显示大纲时的全屏样式 */
.w-md-editor-fullscreen:not(.with-outline) {
  width: 100% !important;
  right: 0 !important;
}

/* 全屏模式下的大纲面板样式 */
.w-md-editor-fullscreen.with-outline + .outline-panel {
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background-color: #f8f9fa !important;
  border-left: 1px solid #dee2e6 !important;
}

/* 移动设备上的全屏模式 */
@media (max-width: 768px) {
  .w-md-editor-fullscreen {
    width: 100% !important;
    right: 0 !important;
  }
}

/* 修改全屏模式相关样式 */
.w-md-editor-fullscreen.with-outline {
  width: calc(100% - 250px) !important;
  left: 0 !important;
  right: 250px !important;
  margin: 0 !important;
}

/* 全屏模式下的大纲面板样式 */
.w-md-editor-fullscreen.with-outline + .outline-panel {
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background-color: #f8f9fa !important;
  border-left: 1px solid #dee2e6 !important;
}

/* Mermaid 流程图样式 */
.mermaid-container {
  width: 100%;
  overflow: auto;
  margin: 1rem 0;
  text-align: center;
}

.mermaid-container svg {
  max-width: 100%;
  height: auto;
}

.error-message {
  color: #e74c3c;
  padding: 10px;
  border: 1px solid #e74c3c;
  border-radius: 4px;
  background-color: #fadbd8;
  margin: 10px 0;
}

/* 流程图按钮样式 */
.navbar-button[title="插入流程图 (Ctrl+M)"] {
  background-color: #3498db;
  color: white;
}

.navbar-button[title="插入流程图 (Ctrl+M)"]:hover {
  background-color: #2980b9;
}

/* 甘特图按钮样式 */
.navbar-button[title="插入甘特图 (Alt+G)"] {
  background-color: #2ecc71;
  color: white;
}

.navbar-button[title="插入甘特图 (Alt+G)"]:hover {
  background-color: #27ae60;
}

/* 时序图按钮样式 */
.navbar-button[title="插入时序图 (Alt+S)"] {
  background-color: #e74c3c;
  color: white;
}

.navbar-button[title="插入时序图 (Alt+S)"]:hover {
  background-color: #c0392b;
}

/* 自定义Markdown预览样式 */
.custom-markdown-preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Mermaid块样式 */
.mermaid-block {
  background-color: white;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

/* Mermaid错误显示样式 */
.mermaid-error {
  border: 1px solid #e74c3c;
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  background-color: #fdf3f2;
}

.mermaid-source-code {
  background-color: #f8f9fa;
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  color: #2c3e50;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 甘特图专用样式 */
.mermaid-container svg.mermaid {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  min-height: 300px;
}

/* 确保甘特图中的文本可见 */
.mermaid-container .taskText,
.mermaid-container .sectionTitle,
.mermaid-container text.titleText {
  fill: #2c3e50;
  font-weight: normal;
  font-family: 'Arial', sans-serif;
}

/* 强化甘特图中的标题 */
.mermaid-container text.titleText {
  font-size: 16px;
  font-weight: bold;
}

/* 确保甘特图中的日期标签清晰可见 */
.mermaid-container .taskTextOutsideRight,
.mermaid-container .taskTextOutsideLeft,
.mermaid-container .taskText {
  fill: #333;
  text-anchor: middle;
}

/* 美化甘特图中的任务条 */
.mermaid-container .task {
  stroke-width: 1;
}

/* 加强甘特图任务的悬停效果 */
.mermaid-container .task:hover {
  filter: brightness(0.9);
}

/* 甘特图备用显示样式 - 完全重写 */
.gantt-fallback {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

.gantt-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

.gantt-chart {
  position: relative;
  min-width: 600px;
}

.gantt-timeline-header {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.gantt-timeline-marker {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
}

.gantt-section {
  margin-bottom: 1.5rem;
}

.gantt-section-name {
  font-weight: 600;
  color: #343a40;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: #e9ecef;
  border-radius: 4px;
}

.gantt-section-tasks {
  padding-left: 1rem;
}

.gantt-task-row {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: center;
}

.gantt-task-name {
  width: 120px;
  padding-right: 1rem;
  font-size: 0.9rem;
  color: #495057;
}

.gantt-task-timeline {
  flex: 1;
  height: 30px;
  background-color: #f1f3f5;
  border-radius: 4px;
  position: relative;
}

.gantt-task-bar {
  position: absolute;
  height: 100%;
  background: linear-gradient(to right, #3498db, #2980b9);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gantt-task-label {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}